set incsearch
set nocompatible
set autoindent
set backspace=start,indent,eol
set history=400
set autoread
"set lz
"set so=7
set cmdheight=2
"set magic
"set hid
set tags=tags;
set autochdir
set hlsearch

set showcmd
set ruler
if &t_Co > 2 || has("gui_running")
  syntax on 
  set hlsearch
  set guifont=consolas:h12
  colorscheme desert
endif
set shiftwidth=2
set cindent
syntax enable
set showmatch
set expandtab
au FileType html,python,vim,javascript setl shiftwidth=2
au FileType html,python,vim,javascript setl tabstop=2
au FileType java,php setl shiftwidth=4
au FileType java,php setl tabstop=4
au FileType php setlocal dict+=$VIM/vimfiles/doc/php_funclist.txt
if !exists('g:AutoComplPop_Behavior')
    let g:AutoComplPop_Behavior = {}
    let g:AutoComplPop_Behavior['php'] = []
    call add(g:AutoComplPop_Behavior['php'], {
            \   'command'   : "\<C-x>\<C-o>", 
            \   'pattern'   : printf('\(->\|::\|\$\)\k\{%d,}$', 0),
            \   'repeat'    : 0,
            \})
endif

set fileencodings=ucs-bom,utf-8,gbk,default,latin1
set smarttab
set lbr
set tw=0
set si
set wrap
set nu

"NERD tree
map <F8> :NERDTreeToggle<CR>
let NERDChristmasTree=1
let NERDTreeAutoCenter=1
let NERDTreeBookmarksFile=$VIM.'\vimfiles\Data\NerdBookmarks.txt'
let NERDTreeMouseMode=2
let NERDTreeShowBookmarks=1
let NERDTreeShowFiles=1
let NERDTreeShowHidden=1
let NERDTreeShowLineNumbers=1
let NERDTreeWinPos='left'
let NERDTreeWinSize=21

"TagList
map <F6> :TlistToggle<CR>
let Tlist_Auto_Open=0
let Tlist_Compact_Format=1
let Tlist_Ctags_Cmd='ctags'
"Sketch
map <F7> :call ToggleSketch()<CR>
